package com.sbx.controller;

import com.sbx.entity.dto.Route;
import com.sbx.service.RouteService;
import com.sbx.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/route")
@Api(tags = "路由管理")
public class RouteController {
    @Resource
    private RouteService routeService;

    @GetMapping("{roleId}")
    @ApiOperation("查询")
    public Result getPath(@PathVariable @ApiParam("角色id") String roleId) {
        List<Route> path = routeService.getPath(roleId);
        return Result.success(path);
    }

}
